package com.autoMobile.servlet;

import com.autoMobile.bean.ddmUser1;
import com.autoMobile.dao.ddmUserDao;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;


@WebServlet("/ddm/zktbServlet1")
public class zktbServlet1 extends HttpServlet {
	private static final long serialVersionUID = 1L;


    public zktbServlet1() {
        super();
        // TODO Auto-generated constructor stub
    }

	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		this.doPost(request, response);
	}

	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		request.setCharacterEncoding("UTF-8");
//		String so=request.getParameter("soil");
//		String om=request.getParameter("omil");
		String cond=request.getParameter("zhuang");
//		String sh=request.getParameter("shuo");
		String ok=request.getParameter("okm");
		String oo=request.getParameter("ooil");
		String ra=request.getParameter("ram");
		String mess=request.getParameter("message");


		ddmUser1 user= (ddmUser1) getServletContext().getAttribute("ddmUser");
		System.out.println("ServletUp:"+user.toString());
//		user.setSoil(so);
//		user.setOmil(om);
		user.setZhuang(cond);
//		user.setShuo(sh);
		user.setOkm(ok);
		user.setOoil(oo);
		user.setRam(ra);
		user.setMessage(mess);
		System.out.println("ServletUp:"+user.toString());
		new ddmUserDao().updateFieldsLiCheng(user);
		response.sendRedirect(request.getContextPath()+"/employee/zhuangkuang.jsp");
	}

}
